<template>
  <div class="vipBonusCabinet">
    <div v-for="card in cards" :key="card.id" class="item">
      <div class="itemLeft">
        <NuxtImg :src="card.icon" alt="icon" class="img" />
        <span>{{ card.title }}</span>
        <div>
          <div class="btnTitle" v-click-move @click="onHelp(card)">
            <NuxtImg :src="assets.help" alt="help" />
          </div>
        </div>
      </div>
      <div class="btn sl_box_shadow btnMask">
        <p>{{ lang.cabinet_add }}</p>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
const lang: any = getCurrentPageLang("activity/vip");

const assets = {
  cashback: "/images/activity/vip/BonusCabinet_3.png",
  daily: "/images/activity/vip/BonusCabinet_4.png",
  weekly: "/images/activity/vip/BonusCabinet_5.png",
  monthly: "/images/activity/vip/BonusCabinet_6.png",
  help: "/images/layout/Icon_Que.png",
};

const cards: any[] = [
  {
    id: 1,
    title: lang.cabinet_cashback,
    icon: assets.cashback,
    tipTitle: lang.bonus_tip_1_title,
    tipDesc: lang.bonus_tip_1_desc,
  },
  {
    title: lang.cabinet_daily,
    icon: assets.daily,
    tipTitle: lang.bonus_tip_2_title,
    tipDesc: lang.bonus_tip_2_desc,
  },
  {
    id: 3,
    title: lang.cabinet_weekly,
    icon: assets.weekly,
    tipTitle: lang.bonus_tip_3_title,
    tipDesc: lang.bonus_tip_3_desc,
  },
  {
    id: 4,
    title: lang.cabinet_monthly,
    icon: assets.monthly,
    tipTitle: lang.bonus_tip_4_title,
    tipDesc: lang.bonus_tip_4_desc,
  },
];

function onHelp(item: any) {
  showDialog({
    title: item.tipTitle,
    message: item.tipDesc,
    destroyOnClose: true,
    className: "custom-dialog",
    showConfirmButton: false,
    showCancelButton: true,
    messageAlign: "left",
  });
}
</script>

<style scoped lang="scss">
.vipBonusCabinet {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.3rem;
  background: var(--theme-color4);
  border-radius: 0.2rem;
  gap: 0.43rem;
  margin-top: 0.24rem;

  .item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--theme-color3);
    border-radius: 0.15rem;
    padding: 0.2rem 0.18rem 0.2rem 0.24rem;

    .itemLeft {
      display: flex;
      align-items: center;
      gap: 0.2rem;

      img {
        width: 0.86rem;
        height: 0.86rem;
        margin-right: 0.09rem;
        vertical-align: middle;
      }

      span {
        color: var(--theme-neutral1);
        font-size: 0.38rem;
      }

      .btnTitle img {
        width: 0.46rem;
        height: 0.46rem;
      }
    }

    .btn {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: var(--theme-color4);
      width: 2.5rem;
      height: 0.8rem;
      border-radius: 0.5rem;
      padding: 0.1rem;

      p {
        margin: 0;
      }
    }

    .btnMask {
      position: relative;
    }
  }
}
</style>
